<template>
  <div class="app-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="耗材" name="1" ref="supplies">
        <supplies v-if="activeName == '1'" />
      </el-tab-pane>
      <el-tab-pane label="一般化学试剂" name="2" ref="generalChemistry">
        <generalChemistry v-if="activeName == '2'" />
      </el-tab-pane>
      <el-tab-pane label="易制毒化学试剂" name="3" ref="precursorPoisoning">
        <precursorPoisoning v-if="activeName == '3'" />
      </el-tab-pane>
      <el-tab-pane label="易制爆化学试剂" name="4" ref="easyExplode">
        <easyExplode v-if="activeName == '4'" />
      </el-tab-pane>
      <el-tab-pane label="标准化学试剂" name="5" ref="standard">
        <standard v-if="activeName == '5'" />
      </el-tab-pane>
    </el-tabs>
    <el-button
      size="mini"
      style="position: absolute;right:170px;top:125px;"
      type="text"
      @click="earlyWarning"
      >告警/预警设置</el-button
    >
    <el-button
      size="mini"
      style="position: absolute;right:40px;top:125px;"
      type="text"
      @click="Notificationsettings"
      >计量单位自定义配置</el-button
    >
    <!-- 自定义配置 -->
    <el-dialog
      title="计量单位自定义配置"
      :visible.sync="NotificationsettingsV"
      center
    >
      <el-form ref="orderForm" :model="orderForm">
        <el-card shadow="never">
          <div slot="header">
            <span>大包装单位<i class="el-input__icon"/></span>
          </div>
          <el-row>
            <el-col
              v-for="(item, index) in orderForm.bigList"
              :key="index"
              :span="3"
            >
              <el-form-item label-width="10px">
                <el-input
                  v-model="item.unit"
                  size="medium"
                  :disabled="true"
                  :max="99999.99"
                  style="width: 46%;margin-right:3px"
                />
                <el-button
                  type="text"
                  size="small"
                  @click.prevent="removeDomain(item)"
                  >删除</el-button
                >
              </el-form-item>
            </el-col>

            <el-col :span="3">
              <el-form-item label-width="10px">
                <el-button
                  type="primary"
                  size="small"
                  style="width: 46%"
                  icon="el-icon-circle-plus-outline"
                  @click="showAddPrice"
                ></el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card shadow="never">
          <div slot="header">
            <span>小包装单位<i class="el-input__icon"/></span>
          </div>
          <el-row>
            <el-col
              v-for="(item, index) in orderForm.smallList"
              :key="index"
              :span="3"
            >
              <el-form-item label-width="10px">
                <el-input
                  v-model="item.unit"
                  size="medium"
                  :disabled="true"
                  :max="99999.99"
                  style="width: 46%;margin-right:3px"
                />
                <el-button
                  type="text"
                  size="small"
                  @click.prevent="removeDomain1(item)"
                  >删除</el-button
                >
              </el-form-item>
            </el-col>

            <el-col :span="3">
              <el-form-item label-width="10px">
                <el-button
                  type="primary"
                  size="small"
                  style="width: 46%"
                  icon="el-icon-circle-plus-outline"
                  @click="showAddPrice1"
                ></el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card shadow="never">
          <div slot="header">
            <span>基本计量单位<i class="el-input__icon"/></span>
          </div>
          <el-row>
            <el-col
              v-for="(item, index) in orderForm.measureList"
              :key="index"
              :span="3"
            >
              <el-form-item label-width="10px">
                <el-input
                  v-model="item.unit"
                  size="medium"
                  :disabled="true"
                  :max="99999.99"
                  style="width: 46%;margin-right:3px"
                />
                <el-button
                  type="text"
                  size="small"
                  @click.prevent="removeDomain2(item)"
                  >删除</el-button
                >
              </el-form-item>
            </el-col>

            <el-col :span="3">
              <el-form-item label-width="10px">
                <el-button
                  type="primary"
                  size="small"
                  style="width: 46%"
                  icon="el-icon-circle-plus-outline"
                  @click="showAddPrice2"
                ></el-button>
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="NotificationsettingsV = false">取消</el-button>
        <el-button type="primary" @click="validatoProInput">确认</el-button>
      </div>
    </el-dialog>
    <el-dialog
      :title="titleMap[orderDialogStatus]"
      :visible.sync="innerPriceVisible"
      append-to-body
      center
      width="500px"
      top="5vh"
    >
      <div style="width: 450px;margin:0 auto;">
        <el-form :model="addPriceForm" label-width="120px">
          <el-form-item label="单位:">
            <el-input v-model="addPriceForm.unit" style="width:250px;" />
          </el-form-item>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="innerPriceVisible = false">取消</el-button>
        <el-button type="primary" @click="confirmPrice">确认</el-button>
      </div>
    </el-dialog>

    <!-- 预警设置 -->
    <el-dialog
      title="试剂耗材预警设置"
      :visible.sync="innerPriceWarning"
      append-to-body
      center
      width="1000px"
    >
      <div style="margin:0 auto;">
        <el-form :model="warning" label-width="180px">
          <div style="display: flex;">
            <el-card shadow="never" style="width: 50%">
              <div slot="header">
                <span>过期预警<i class="el-input__icon"/></span>
              </div>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="提前" style="width: 300px">
                    <el-input v-model="warning.advent" style="width:70px;" />
                    <span>&nbsp;&nbsp;天预警</span>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <el-card shadow="never" style="width: 50%">
              <div slot="header">
                <span>库存预警<i class="el-input__icon"/></span>
              </div>
              <el-row>
                <el-col :span="8">
                  <el-form-item label="库存低于总量" style="width: 300px">
                    <el-input
                      min="0"
                      max="100"
                      v-model="warning.stock"
                      style="width: 70px"
                    />
                    <span>&nbsp;&nbsp;%预警</span>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-card>
          </div>
        </el-form>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="innerPriceWarning = false">取消</el-button>
        <el-button type="primary" @click="confirmWarning">确认</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import supplies from "./supplies/index.vue";
import generalChemistry from "./generalChemistry/index.vue";
import precursorPoisoning from "./precursorPoisoning/index.vue";
import easyExplode from "./easyExplode/index.vue";
import standard from "./standard/index.vue";
import * as reagentsGlance from "@/api/reagentsGlance";
export default {
  components: {
    supplies,
    precursorPoisoning,
    generalChemistry,
    easyExplode,
    standard,
    reagentsGlance
  },
  data() {
    return {
      activeName: "1",
      NotificationsettingsV: false,
      innerPriceWarning: false,
      innerPriceVisible: false,
      orderDialogStatus: "create",
      titleMap: {
        edit: "新增小包装单位",
        create: "新增大包装单位",
        Visible: "新增基本计量单位"
      },
      orderForm: {
        bigList: [],
        smallList: [],
        measureList: []
      },
      addPriceForm: {
        unit: ""
      },
      measureList: {},
      smallList: {},
      bigList: {},
      warning: {
        advent: "90",
        stock: "30"
      }
    };
  },
  methods: {
    handleClick() {},

    earlyWarning() {
      reagentsGlance.noticeDetail().then(res => {
        console.log(res);
        if (res.code === 200) {
          this.warning = res.result;
          this.warning.stock = parseFloat((this.warning.stock * 100).toFixed(10));
          console.log(this.warning.stock);
        }
      });
      this.innerPriceWarning = true;
    },

    confirmWarning() {
      this.warning.stock = this.warning.stock / 100;
      reagentsGlance.alertSet(this.warning).then(res => {
        if (res.code === 200) {
          console.log(res);
          this.$notify({
            title: "成功",
            message: res.message,
            type: "success"
          });
          this.innerPriceWarning = false;
        } else {
          this.$notify({
            title: "失败",
            message: res.message,
            type: "error"
          });
        }
      });
    },

    Notificationsettings() {
      this.NotificationsettingsV = true;
      reagentsGlance.unitDropDown().then(res => {
        console.log(res);
        if (res.code === 200) {
          this.orderForm.measureList = res.result.measureList || [];
          this.orderForm.smallList = res.result.smallList || [];
          this.orderForm.bigList = res.result.bigList || [];
        }
      });
    },
    //新增大包装单位
    showAddPrice() {
      this.orderDialogStatus = "create";
      this.addPriceForm = {
        unit: "",
        type: 1
      };
      this.innerPriceVisible = true;
    },
    //新增小包装单位
    showAddPrice1() {
      this.orderDialogStatus = "edit";
      this.addPriceForm = {
        unit: "",
        type: 2
      };
      this.innerPriceVisible = true;
    },
    //新增基本计量单位
    showAddPrice2() {
      this.orderDialogStatus = "Visible";
      this.addPriceForm = {
        unit: "",
        type: 3
      };
      this.innerPriceVisible = true;
    },
    //确认新增单位
    confirmPrice() {
      if (this.addPriceForm.unit != "") {
        if (this.addPriceForm.type == 1) {
          this.orderForm.bigList.push({
            unit: this.addPriceForm.unit,
            type: 1
          });
          reagentsGlance
            .addReagentUnit({ unit: this.addPriceForm.unit, type: 1 })
            .then(res => {
              console.log(22);
              if (res.code === 200) {
                console.log(res);
                this.$notify({
                  title: "成功",
                  message: res.message,
                  type: "success"
                });
                this.orderDialogVisible = false;
              } else {
                this.$notify({
                  title: "失败",
                  message: res.message,
                  type: "error"
                });
              }
            });
        }
        if (this.addPriceForm.type == 2) {
          this.orderForm.smallList.push({
            unit: this.addPriceForm.unit,
            type: 2
          });
          reagentsGlance
            .addReagentUnit({ unit: this.addPriceForm.unit, type: 2 })
            .then(res => {
              console.log(22);
              if (res.code === 200) {
                console.log(res);
                this.$notify({
                  title: "成功",
                  message: res.message,
                  type: "success"
                });
                this.orderDialogVisible = false;
              } else {
                this.$notify({
                  title: "失败",
                  message: res.message,
                  type: "error"
                });
              }
            });
        }
        if (this.addPriceForm.type == 3) {
          this.orderForm.measureList.push({
            unit: this.addPriceForm.unit,
            type: 3
          });
          reagentsGlance
            .addReagentUnit({ unit: this.addPriceForm.unit, type: 3 })
            .then(res => {
              console.log(22);
              if (res.code === 200) {
                console.log(res);
                this.$notify({
                  title: "成功",
                  message: res.message,
                  type: "success"
                });
                this.orderDialogVisible = false;
              } else {
                this.$notify({
                  title: "失败",
                  message: res.message,
                  type: "error"
                });
              }
            });
        }

        this.innerPriceVisible = false;
      } else {
        this.$message.warning("请录入完整信息");
      }
    },
    //删除大包装单位
    removeDomain(item) {
      console.log(item);
      this.$confirm('是否确认删除名称为"' + item.unit + '"的数单位?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        reagentsGlance
          .removeUnit({
            id: item.id
          })
          .then(result => {
            if (result.code === 200) {
              var index = this.orderForm.bigList.indexOf(item);
              if (index !== -1) {
                this.orderForm.bigList.splice(index, 1);
              }
              this.$notify({
                title: "成功",
                message: result.message,
                type: "success"
              });
            } else {
              this.$notify({
                title: "失败",
                message: result.message,
                type: "error"
              });
            }
          });
      });
    },
    //删除小包装单位
    removeDomain1(item) {
      this.$confirm('是否确认删除名称为"' + item.unit + '"的单位?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        reagentsGlance
          .removeUnit({
            id: item.id
          })
          .then(result => {
            if (result.code === 200) {
              var index = this.orderForm.smallList.indexOf(item);
              if (index !== -1) {
                this.orderForm.smallList.splice(index, 1);
              }
              this.$notify({
                title: "成功",
                message: result.message,
                type: "success"
              });
            } else {
              this.$notify({
                title: "失败",
                message: result.message,
                type: "error"
              });
            }
          });
      });
    },
    //删除基本计量单位
    removeDomain2(item) {
      this.$confirm('是否确认删除名称为"' + item.unit + '"的单位?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        reagentsGlance
          .removeUnit({
            id: item.id
          })
          .then(result => {
            if (result.code === 200) {
              var index = this.orderForm.measureList.indexOf(item);
              if (index !== -1) {
                this.orderForm.measureList.splice(index, 1);
              }
              this.$notify({
                title: "成功",
                message: result.message,
                type: "success"
              });
            } else {
              this.$notify({
                title: "失败",
                message: result.message,
                type: "error"
              });
            }
          });
      });
    },
    validatoProInput() {
      this.NotificationsettingsV = false;
    }
  }
};
</script>

<style lang="scss" scoped>
.search_div {
  > div {
    &:nth-child(1) {
      margin-right: 10px;
    }
    display: inline-block;
  }
}

.search_input {
  width: 200px;
  margin-bottom: 5px;
}
.search-right {
  text-align: right;
  padding-right: 25px;
}
.item {
  font-size: 16px;
}
::v-deep .el-card .el-card__header {
  padding: 5px 20px;
  background: #f3f2f2;
}
.block-flex {
  position: relative;
  display: flex;
  & > div {
    border: 1px solid #b7b7b7;
    width: 100px;
    margin: 0;
    line-height: 30px;
    text-align: center;
  }
  & > div:first-child {
    background: #b7b7b7;
  }
}
.card-left {
  width: 100%;
  min-height: 200px;
  max-height: 450px;
}
.card-right {
  width: 100%;
  min-height: 200px;
  max-height: 450px;
}
.el-card {
  overflow: auto;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 14px;
}
// /deep/.main-body .el-table__header-wrapper  .el-checkbox{
//   display:none
// }
.agreement_picture {
  min-height: calc(100%);
  .pdf {
    height: calc(100%);
  }
}

/deep/ .el-input.is-disabled .el-input__inner {
  color: unset;
}

/deep/.i-input .el-input__inner {
  text-align: center;
}
/deep/.right-input .el-input__inner {
  text-align: right;
}

.el-header {
  line-height: 45px;
  height: 45px;
}
.el-footer {
  text-align: right;
  line-height: 45px;
  height: 45px;

  .pagination-container {
    padding: 0;
    margin-top: 10px;
    margin-bottom: 45px;
  }
}
.el-main {
  overflow-y: auto;
}
.el-container {
  max-height: 450px;
}

.text {
  font-size: 14px;
}
.dialog-item {
  padding-left: 3px;
  line-height: 30px;
  cursor: pointer;
}
.dialog-item:hover {
  background: #e8f4ff;
  border-radius: 3px;
}

table {
  background-color: transparent;
}

caption {
  padding-top: 8px;
  padding-bottom: 8px;
  color: #777;
  text-align: left;
}

th {
  text-align: left;
}

.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
}

.table > tbody > tr > td,
.table > tbody > tr > th,
.table > tfoot > tr > td,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > thead > tr > th {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: middle;
  border-top: 1px solid #ddd;
}

.table > thead > tr > th {
  vertical-align: bottom;
  border-bottom: 2px solid #ddd;
}

.table > caption + thead > tr:first-child > td,
.table > caption + thead > tr:first-child > th,
.table > colgroup + thead > tr:first-child > td,
.table > colgroup + thead > tr:first-child > th,
.table > thead:first-child > tr:first-child > td,
.table > thead:first-child > tr:first-child > th {
  border-left: 1px solid #f1f2f4;
}

.table > tbody + tbody {
  border-top: 2px solid #ddd;
}

.table .table {
  background-color: #fff;
}

.table-condensed > tbody > tr > td,
.table-condensed > tbody > tr > th,
.table-condensed > tfoot > tr > td,
.table-condensed > tfoot > tr > th,
.table-condensed > thead > tr > td,
.table-condensed > thead > tr > th {
  padding: 5px;
}

.table-bordered {
  border: 1px solid #ddd;
}

.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid #ddd;
}

.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border-bottom-width: 2px;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #f9f9f9;
}

.table-hover > tbody > tr:hover {
  background-color: #f5f5f5;
}

table col[class*="col-"] {
  position: static;
  display: table-column;
  float: none;
}

table td[class*="col-"],
table th[class*="col-"] {
  position: static;
  display: table-cell;
  float: none;
}

.table > tbody > tr.active > td,
.table > tbody > tr.active > th,
.table > tbody > tr > td.active,
.table > tbody > tr > th.active,
.table > tfoot > tr.active > td,
.table > tfoot > tr.active > th,
.table > tfoot > tr > td.active,
.table > tfoot > tr > th.active,
.table > thead > tr.active > td,
.table > thead > tr.active > th,
.table > thead > tr > td.active,
.table > thead > tr > th.active {
  background-color: #f5f5f5;
}

.table-hover > tbody > tr.active:hover > td,
.table-hover > tbody > tr.active:hover > th,
.table-hover > tbody > tr:hover > .active,
.table-hover > tbody > tr > td.active:hover,
.table-hover > tbody > tr > th.active:hover {
  background-color: #e8e8e8;
}

.table > tbody > tr.success > td,
.table > tbody > tr.success > th,
.table > tbody > tr > td.success,
.table > tbody > tr > th.success,
.table > tfoot > tr.success > td,
.table > tfoot > tr.success > th,
.table > tfoot > tr > td.success,
.table > tfoot > tr > th.success,
.table > thead > tr.success > td,
.table > thead > tr.success > th,
.table > thead > tr > td.success,
.table > thead > tr > th.success {
  background-color: #dff0d8;
}

.table-hover > tbody > tr.success:hover > td,
.table-hover > tbody > tr.success:hover > th,
.table-hover > tbody > tr:hover > .success,
.table-hover > tbody > tr > td.success:hover,
.table-hover > tbody > tr > th.success:hover {
  background-color: #d0e9c6;
}

.table > tbody > tr.info > td,
.table > tbody > tr.info > th,
.table > tbody > tr > td.info,
.table > tbody > tr > th.info,
.table > tfoot > tr.info > td,
.table > tfoot > tr.info > th,
.table > tfoot > tr > td.info,
.table > tfoot > tr > th.info,
.table > thead > tr.info > td,
.table > thead > tr.info > th,
.table > thead > tr > td.info,
.table > thead > tr > th.info {
  background-color: #d9edf7;
}

.table-hover > tbody > tr.info:hover > td,
.table-hover > tbody > tr.info:hover > th,
.table-hover > tbody > tr:hover > .info,
.table-hover > tbody > tr > td.info:hover,
.table-hover > tbody > tr > th.info:hover {
  background-color: #c4e3f3;
}

.table > tbody > tr.warning > td,
.table > tbody > tr.warning > th,
.table > tbody > tr > td.warning,
.table > tbody > tr > th.warning,
.table > tfoot > tr.warning > td,
.table > tfoot > tr.warning > th,
.table > tfoot > tr > td.warning,
.table > tfoot > tr > th.warning,
.table > thead > tr.warning > td,
.table > thead > tr.warning > th,
.table > thead > tr > td.warning,
.table > thead > tr > th.warning {
  background-color: #fcf8e3;
}

.table-hover > tbody > tr.warning:hover > td,
.table-hover > tbody > tr.warning:hover > th,
.table-hover > tbody > tr:hover > .warning,
.table-hover > tbody > tr > td.warning:hover,
.table-hover > tbody > tr > th.warning:hover {
  background-color: #faf2cc;
}

.table > tbody > tr.danger > td,
.table > tbody > tr.danger > th,
.table > tbody > tr > td.danger,
.table > tbody > tr > th.danger,
.table > tfoot > tr.danger > td,
.table > tfoot > tr.danger > th,
.table > tfoot > tr > td.danger,
.table > tfoot > tr > th.danger,
.table > thead > tr.danger > td,
.table > thead > tr.danger > th,
.table > thead > tr > td.danger,
.table > thead > tr > th.danger {
  background-color: #f2dede;
}

.table-hover > tbody > tr.danger:hover > td,
.table-hover > tbody > tr.danger:hover > th,
.table-hover > tbody > tr:hover > .danger,
.table-hover > tbody > tr > td.danger:hover,
.table-hover > tbody > tr > th.danger:hover {
  background-color: #ebcccc;
}

.table-responsive {
  min-height: 3.01%;
  overflow-x: auto;
}

.table-bordered,
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tfoot > tr > td,
.table-bordered > tfoot > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid #e9ecef;
  text-align: center;
  line-height: 14px;
}

.table-bordered,
td,
th {
  border-radius: 0 !important;
}

.table-bordered > tbody > tr:last-child > td {
  border-bottom: 1px solid #e9ecef;
}

.bootstrap-table .fixed-table-container .fixed-table-header {
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
}

.fixed-table-header .table > thead > tr {
  background: none !important;
}

.table > thead > tr {
  color: #636363;
  font-weight: 400;
  background: rgba(0, 0, 0, 0.05);
  /*   background: repeat-x #fafafa;
  background-image: -webkit-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: -o-linear-gradient(top,#F8F8F8 0,#fafafa 100%);
  background-image: linear-gradient(to bottom,#F8F8F8 0,#fafafa 100%);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff8f8f8', endColorstr='#ffececec', GradientType=0); */
}

.table > thead > tr > th {
  border-color: #e9ecef;
  font-weight: 700;
  border-right-color: transparent;
}

.table > thead > tr > th .ace-icon:first-child {
  margin-right: 2px;
}

.table > thead > tr > th:first-child {
  border-left-color: #f1f1f1;
}

.table > thead > tr > th:last-child {
  border-right-color: #f1f1f1;
}

.table.table-bordered > thead > tr > th {
  vertical-align: middle;
}

td.center,
th.center {
  text-align: center;
}

td .lbl,
th .lbl {
  margin-bottom: 0;
}

td .lbl:only-child,
th .lbl:only-child {
  vertical-align: top;
}

.table-header {
  background-color: #307ecc;
  color: #fff;
  font-size: 14px;
  line-height: 38px;
  padding-left: 12px;
  margin-bottom: 1px;
}

.table-header .close {
  margin-right: 8px;
  margin-top: 0;
  opacity: 0.45;
  filter: alpha(opacity=45);
}

.table-header .close:hover {
  opacity: 0.75;
  filter: alpha(opacity=75);
}

th.detail-col {
  width: 48px;
  text-align: center;
}

tr.detail-row {
  display: none;
}

tr.detail-row.open {
  display: block;
  display: table-row;
}

tr.detail-row > td {
  background-color: #f1f6f8;
  border-top: 3px solid #d1e1ea !important;
}

.table-detail {
  background-color: #fff;
  border: 1px solid #dcebf7;
  width: 100%;
  padding: 12px;
}

.table-detail td > .profile-user-info {
  width: 100%;
}
.clearfix {
  line-height: 40px;
  display: flex;
}
.el-dropdown-link {
  cursor: pointer;
  color: #409eff;
}
.el-icon-arrow-down {
  font-size: 12px;
}
.install-title {
  display: flex;
  align-items: center;
  line-height: 30px;
  padding-left: 20px;
  color: #fff;
  background-color: #d7dae2;
  justify-content: flex-start;
  margin-bottom: 10px;
}
.delete {
  width: 10px;
  height: 10px;
  position: relative;
  top: -10px;
  cursor: pointer;
}
::v-deep .el-upload-list {
  width: 100px;
  display: flex;
  margin: 10px 10px;
}
::v-deep .el-upload-list > li {
  margin: 10px 10px;
}
::v-deep.el-upload-list__item {
  margin: 10px 10px;
}
::v-deep.el-upload-list--picture .el-upload-list__item {
  margin: 10px 10px !important;
}
.user-info-head {
  position: relative;
  display: inline-block;
  height: 120px;
}

::v-deep.avatar-upload-preview {
  width: 400px;
  border-radius: 0%;
  height: 400px;
  > img {
    transform: translateX(0);
  }
}
.user-info-head:hover:after {
  content: "+";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  color: #eee;
  background: rgba(0, 0, 0, 0.5);
  font-size: 24px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  cursor: pointer;
  line-height: 110px;
  border-radius: 50%;
}

/deep/.upload-dragger {
  background-color: #fff;
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.cropper-wrapper {
  //height: calc(100vh - 50px);
  .pre-box {
    button {
      width: 100px;
      margin-top: 15px;
    }
  }
}

/deep/.el-dialog {
  position: relative;
  margin: 0 auto 50px;
  background: #fff;
  border-radius: 2px;
  box-sizing: border-box;
  width: 80%;
}

.crop-dialog {
  .cropper-content {
    padding: 0 40px;

    .cropper {
      width: 900px;
      height: 900px;
    }
  }

  .action-box {
    padding: 25px 40px 0 40px;
    display: flex;
    justify-content: center;

    button {
      width: 80px;
      margin-right: 15px;
    }
  }

  .dialog-footer {
    button {
      width: 100px;
    }
  }
}
</style>
